GREGOR

Syntax: GREGOR (day%, month%, year%) 
Location: Math Package

The function GREGOR takes three integers (others are rounded to the nearest integer) to specify a date and returns the weekday as a number from 1 to 7 where:
   
1 = Sunday,           ( See Note 1 !)   
2 = Monday,   
3 = Tuesday,   
4 = Wednesday,   
5 = Thursday,   
6 = Friday, and       
7 = Saturday.

As the name of the function suggests GREGOR uses the Gregorian calender. This was introduced in 1583, so GREGOR has to refuse earlier years. Invalid parameters are not reported by breaking with an error (unless one of the parameters is out of integer range) but by returning zero. 

NOTE:
GREGOR was originally intended to return 1 for Monday, 2 for Tuesday and so on. The current version (v2.05) follows the Christian tradition where Sunday was regarded as the first day of the week.

CROSS-REFERENCE:
EASTER, DAY$
